<script setup>
import {useRoute, useRouter} from 'vue-router'
import {Document, House, Setting, User, UserFilled} from "@element-plus/icons-vue";

const router = useRouter()
const route = useRoute()
</script>

<template>
  <el-container>
    <el-header style="display: flex; align-items: center;">
      <a href="/" target="balnk">
        <img src="@/assets/img/LogosTelegram.svg" style="width: 50px; margin-right: 20px;" alt/>
      </a>

      <h1>吉吉图书馆管理面板</h1>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu
            active-text-color="#ffd04b"
            background-color="#2f4056"
            :default-active="route.path"
            text-color="#fff"
            :router="true"
        >
          <el-menu-item index="/">
            <el-icon><House /></el-icon>
          <span >返回首页</span>
        </el-menu-item>
          <el-menu-item index="/manage/personal">
            <el-icon>
              <user/>
            </el-icon>
            <span>个人中心</span>
          </el-menu-item>
          <el-menu-item index="/manage/avatarUploader">
            <el-icon>
              <user/>
            </el-icon>
            <span>修改用户图标</span>
          </el-menu-item>
          <el-menu-item index="/manage/setUseImg">
            <el-icon>
              <user-filled/>
            </el-icon>
            <span>用户管理</span>
          </el-menu-item>
          <el-menu-item index="/manage/addBook">
            <el-icon>
              <document/>
            </el-icon>
            <span>图书管理</span>
          </el-menu-item>
          <el-menu-item index="/records">
            <el-icon>
              <setting/>
            </el-icon>
            <span>借阅记录管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style scoped>

.el-container,
.el-menu {
  height: 100%;
}

.el-header {
  background: #243346;
  color: #fff;
  border-bottom: 1px solid #4b5461;
}

.el-main {
  background: #f0f2f5;
}
</style>
